import axios from 'axios';

//响应时间
axios.defaults.timeout = 300000; // 5 min
axios.defaults.headers.post['Content-Type'] = 'application/json';



export const get = (url, params, config = {}) => {
    return axios.get(url, {
        params: params,
        headers: {
            'api-key': 'lrJDpzsud=4bXbS6KvK2JjyJAl0='
        },
        ...config,
    }).then(res => res.data);
};

export const post = (url, params, config = {}, otherheaders = {}) => {
    return axios.post(url, params, {
        headers: {
            'api-key': 'N=pMIfe6DEetZSPJ6veolFavtXg=',
            ...otherheaders,
        },
        ...config,
    }).then(res => res.data);
};


export default axios;
